package com.dwxt.cdms.util;

import net.sf.json.JSONObject;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;

/**
 * @author yanlong
 * @version 1.0
 * @className ReqUtils
 * @date 2021/5/9 9:54
 */
public class ReqUtils {
    public static JSONObject getParaJsonObject(HttpServletRequest request) {
        JSONObject jsonObject = new JSONObject();
        Enumeration<String> parameterNames = request.getParameterNames();
        while (parameterNames.hasMoreElements()) {
            String key = parameterNames.nextElement();
            String value = request.getParameter(key);
            jsonObject.put(key, value);
        }
        return jsonObject;
    }
}
